//
//  CardescribeCell.m
//  New_Runway
//
//  Created by mack on 2018/1/25.
//  Copyright © 2018年 NelsonJ. All rights reserved.
//

#import "CardescribeCell.h"

@interface CardescribeCell ()
@property (weak, nonatomic) IBOutlet UILabel *titleL;
@property (weak, nonatomic) IBOutlet UILabel *contentL;

@end

@implementation CardescribeCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(void)setTitle:(NSString *)title{
    self.titleL.text = title;
    
}
-(void)setCarInfo:(CarResult *)carInfo{
    
    _carInfo = carInfo;
        if (_index == 0) {
        self.contentL.text = _carInfo.carFlawDesc;
        if ([self StringIsNullOrEmpty:_carInfo.carFlawDesc] == 1) {
            self.contentL.text = @"--";
        }
    }else if (_index == 1){
        
        self.contentL.text = _carInfo.carSellingPointDesc;
        if ([self StringIsNullOrEmpty:_carInfo.carSellingPointDesc] == 1) {
            self.contentL.text = @"--";
        }
    }else if (_index == 2){
        
        self.contentL.text = _carInfo.carMortgageDesc;
        if ([self StringIsNullOrEmpty:_carInfo.carMortgageDesc] == 1) {
            self.contentL.text = @"--";
        }
    }else{
        self.contentL.text = _carInfo.carRemark;
        if ([self StringIsNullOrEmpty:_carInfo.carRemark] == 1) {
            self.contentL.text = @"--";
        }
    }
}
- (BOOL)StringIsNullOrEmpty:(NSString *)str  
{  
    return (str == nil || [str isKindOfClass:[NSNull class]] || str.length == 0);  
}  
-(void)setIndex:(NSInteger)index{
    _index = index;
   
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
